const bt = require('./bt_20201218104643')
// 先左,后root,后右

const inOrder = (root) => {
    if (!root) {
        return
    }
    // inOrder(root.left);
    // console.log(root.val)
    // inOrder(root.right)
    const stack = [];
    let p = root;
    while (stack.length || p) {
        while (p) {
            stack.push(p)
            p = p.left;
        }
        const n = stack.pop();
        console.log(n.val)
        p = n.right;
    }

}
inOrder(bt)